package com.study.usercenter.controller;

import com.study.usercenter.library.OrderFeign;
import com.study.usercenter.library.OrderLibrary;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {

    @Autowired
    private OrderLibrary orderLibrary;

    @Autowired
    private OrderFeign orderFeign;

    @RequestMapping(value = "/order/info/{id}")
    public String orderInfo(@PathVariable Integer id) {
        return orderLibrary.getOrderInfo(id);
    }

    @RequestMapping(value = "/order/info/feign/{id}")
    public String getOrderInfoByFeign(@PathVariable Integer id) {
        return orderFeign.getOrderInfo(id);
    }

}
